public class LCWeeklyTest383 {
    public int minimumTimeToInitialState(String word, int k) {
        int index = 0;
        int i = 0;
        for(i = 1; ; i++){
            index += k;
            if(index >= word.length()){
                return i;
            }
            String str1 = word.substring(index);
            String str2 = word.substring(0, word.length() - index);
            if(str1.equals(str2)){
                return i;
            }
        }
    }
}
